import {get, post} from '../utils/request'
import {APP_ID, APP_SECRET} from '../utils/consot'

const API_URL = 'http://localhost:8089'

export function getOpenId (code) {
  return get(`${API_URL}/openId/get`, {
    appId: APP_ID,
    secret: APP_SECRET,
    code
  })
}

export function register (openId, userInfo) {
  return post(`${API_URL}/wx/user/register`, {
    openId,
    platform: mpvuePlatform,
    ...userInfo
  })
}

export function getVisitReasonColumns (dictValue, dictLabel) {
  return post(`${API_URL}/wx/dict/list2`, {
    dictValue,
    dictLabel
  })
}

export function getList (dictType) {
  return post(`${API_URL}/wx/dict/list`, {
    dictType
  })
}

export function saveAccess (data) {
  return post(`${API_URL}/wx/access/save`, data)
}

export function getIntervieweeInfo (data) {
  return post(`${API_URL}/wx/user/intervieweeInfo`, {phone: data})
}
